<?php
//$str = 'this_is_a_test';
//$humpstr = implode(' ',array_map('ucfirst',explode('_',$str)));
//echo $humpstr;

#上面这种方式虽然看起来很好简洁，但是这种方式真的是太难理解了
//$str = 'this_is_a_test';
//$words = explode('_',$str);
//$uWords = array_map('ucfirst',$words);
//$humpstr = implode(' ',$uWords);
//echo $humpstr;

//动态访问静态变量
//class C{
//    public static $foo = 123;
//}
//$a = "C";
//echo $a::$foo;


#https://github.com/PizzaLiu/PHP-FIG     php编码规范



//$a = 3;
//$b = 5;
//if($a = 5 || $b = 7){
//    ++$a;
//    $b++;
//}
//echo $a ." " .$b;


//$count = 5;
//function get_count(){
//    static $count = 0;
//    return $count++;
//}
//++$count;
//get_count();
//echo get_count();

//$a = count('567') + count(null) + count(false);
//echo $a;

//$a = 0.2+0.7;
//$b = 0.9;
//var_dump($a == $b);

//其实，对象也能当做数组来使用
//$obj = [];
//$obj[] = 'Append1';
//$obj[] = 'Append2';
//$obj[] = 'Append3';
//print_r($obj);


//$array = array(
//    1 => "a",
//    "1" => "b",
//    1.5 => "c",
//    true => "d"
//);
//var_dump($array);
//
//#混合的integer 和 string 键名
//$array = array(
//    "foo" => "bar",
//    "bar" => "foo",
//    100 => -100,
//    -100 => 100
//);
//var_dump($array);

//使用unset删除数组的元素
//创建一个简单的数组
//$array = array(1,2,3,4,5,6);
////现在删除其中的所有的元素，但是数组本身不变
//foreach($array as $key => $value){
//    unset($array[$key]);
//}
//$array[] = 6;
//print_r($array);



//$a = false;
//$a = (array)$a;
//print_r($a);




